package com.ruoyi.system.enums;


/**
 * @author jifengchen
 * @date 2025/5/8 16:45
 * @description: 论文检测状态
 */

public enum PaperStatusEnums {
    CHECKING("CHECKING","检测中",new int[]{8,1}),

    OTHER_ERROR("OTHER_ERROR","其他异常状态",new int[]{-500}),

    FINISH("FINISH","完成检测",new int[]{2});
    private String code;

    private String desc;

    private int[] checkPassCode;

    /**
     * 根据code获取
     * @param code
     * @return
     */
    public static PaperStatusEnums getByCheckPassCode(int code){
        for (PaperStatusEnums value : PaperStatusEnums.values()) {
            for (int i : value.getCheckPassCode()) {
                if(i == code){
                    return value;
                }
            }
        }
        return null;
    }

    PaperStatusEnums(String code, String desc, int[] checkPassCode) {
        this.code = code;
        this.desc = desc;
        this.checkPassCode = checkPassCode;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int[] getCheckPassCode() {
        return checkPassCode;
    }

    public void setCheckPassCode(int[] checkPassCode) {
        this.checkPassCode = checkPassCode;
    }
}
